﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;
using System.Text;

namespace IHISCETeim.Web.MachineSys.FTradeModel
{
    public partial class FTradeUpKeepEdit : PageBase
    {
        protected override string DWZRef
        {
            get
            {
                return "FTradeReceivablesListEasyUI";
            }
        }

        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.应收帐款_维修保养费 };
            }
        }

        protected int id
        {
            get
            {

                return GetRequestValue<int>("id", 0);
            }
        }

        private FTradeUpKeepInfo _obj = null;
        protected FTradeUpKeepInfo obj
        {
            get
            {
                if (_obj == null)
                    _obj = FTradeUpKeepController.GetById(id);
                return _obj;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();

            }
        }
        private void addmenu()
        {
            FTradeUpKeepInfo obj2 = Request.SerializableObject<FTradeUpKeepInfo>();
            obj2.RealName = base.User.RealName;

            bool msg = FTradeUpKeepController.Update(obj2);

            AddLog(Permission.修改, obj2);

            if (msg)
                SuccessJson("修改成功", "FTradeUpKeepList");
            else
            {

                ErrorJson("修改失败");
            }
        }
    }
}